package Test;

import java.util.ArrayList;
import java.util.List;

import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import RPS.Player;
import RPS.RPSEnum;
import RPS.Result;
import RPS.RockPaperScissors;

public class TestGameSessions {
	
	RockPaperScissors rps;
	Player p1, p2;
	
	@BeforeClass
	  public void setUpClass() {
		rps = new RockPaperScissors();
		
		List a= new ArrayList<RPSEnum>();
		a.add(RPSEnum.SCISSORS);
		a.add(RPSEnum.PAPER);
		List b= new ArrayList<RPSEnum>();
		b.add(RPSEnum.PAPER);
		b.add(RPSEnum.SCISSORS);
		  p1= new Player("p1",a);
		  p2= new Player("p2",b);
	  }
	  
	@AfterClass
	  public void tearDownClass() {
		rps=null;
		  p1=null;
		  p2=null;		  
	  }
	
	@Test
	public void TestWinGame() {
		Result r=rps.play(p1,p2);
		  assert r.equals(Result.WIN);
	}
	
	
	@Test
	public void TestTieGame() {
		Result r=rps.play(p1,p2);
		  assert r.equals(Result.TIE);
	}
	
	@Test
	public void TestLostGame() {
		Result r=rps.play(p1,p2);
		  assert r.equals(Result.LOST);
	}

}
